import _ from 'lodash';
import * as React from 'react';
import {observer} from 'mobx-react';
import {toJS} from 'mobx';
import {Modal, Button, Icon, message} from 'antd';
import {listStore} from '../AdStore';


@observer
export class ApiModal extends React.Component<any,any>{
    close(me){
        return function(){
            listStore.hideApi();
        }
    }

    render(){
        return (
            <Modal title="API" 
                width = {700}
                closable = {false}
                visible={listStore.apiModalVisible}
                onCancel = {this.close(this)}
                footer={[
                    <Button key="close" onClick={this.close(this)}>关闭</Button>
                ]}>
                <p style={{minHeight:'30px'}}>
                    {
                        _.map(listStore.apiUrl, (item)=>{
                            return <p style={{paddingLeft:'10px',paddingBottom:'10px'}}>{item}</p>
                        })
                    }
                </p>
            </Modal>
        )
    }
}